//
//  ViewControllerChooser.m
//  iFlick1.4
//
//  Created by vhly on 10-9-11.
//  Copyright 2010 xhzhang. All rights reserved.
//

#import "ViewControllerChooser.h"

static ViewControllerChooser *chooserInstance;

@implementation ViewControllerChooser

+(ViewControllerChooser *)getInstance{
	if (chooserInstance == nil) {
		chooserInstance = [[ViewControllerChooser alloc] init];
	}
	return chooserInstance;
}

- (id)init{
	if (self = [super init]) {
		
	}
	return self;
}

- (UIViewController *)choice:(NSInteger)vcid{
	UIViewController *ret = nil;
	// TODO Choice ViewController by vcid
	switch (vcid) {
		case VCID_ROOT:
			if (rvc == nil) {
				rvc = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
			}
			ret = rvc;
			break;
		case VCID_UPLOADED:
			if (uvc == nil) {
				uvc = [[UploadedViewController alloc] initWithNibName:@"UploadedViewController" bundle:nil];
			}
			ret = uvc;
			break;

		default:
			break;
	}
	return ret;
}

- (void)dealloc{
	[rvc release];
	[uvc release];
	[super dealloc];
}

@end
